import { createRef, RefObject } from "react";
import { createBrowserRouter, RouteObject } from "react-router-dom";

import App from "@/App";
import Home from "@/pages/Home/index";

export const defaultRouters: Array<RouteObject & { nodeRef: RefObject<any> }> =
  [
    {
      index: true,
      element: <Home />,
      nodeRef: createRef(),
    },
    {
      path: "/detail",
      element: (
        <div>
          dsadsa
          <Home />
        </div>
      ),
      nodeRef: createRef(),
    },
  ];

const router = createBrowserRouter([
  {
    path: "/",
    element: <App />,
    // errorElement:<></>,
    children: defaultRouters,
  },
]);

export default router;
